package SolvedProblems;

import java.util.Scanner;

/**
 *
 * @author Power User
 */
public class KinderGartenCountingProblem {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        
        while (scan.hasNextLine()) {
            int count = 0;
            String line = scan.nextLine();
            boolean charFound = false;
            for(int index = 0; index < line.length(); index++){

                char ch = line.charAt(index);
                if(Character.isLetter(ch)){
                    if(charFound == false){
                        count++;
                    }
                    charFound = true;
                }else{                    
                    charFound = false;
                }
            }//end for
            System.out.println(count);
        }//end while
    }//end main
}//end class
